package com.nbsaas.boot.tech.rest.convert;

import com.nbsaas.boot.tech.data.entity.Technology;
import com.nbsaas.boot.tech.api.domain.simple.TechnologySimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 技术-列表对象转换器
*/

public class TechnologySimpleConvert implements Converter<TechnologySimple, Technology> {




@Override
public TechnologySimple convert(Technology source) {
    TechnologySimple result = new TechnologySimple();

                result.setNote(source.getNote());

               try {
                   if(source.getCreator()!=null){
                       result.setCreator(source.getCreator().getId());
                   }
                } catch (Exception ignored) { }

                result.setIntroduce(source.getIntroduce());
                result.setName(source.getName());

                try {
                    if(source.getCreator()!=null){
                        result.setCreatorName(source.getCreator().getName());
                    }
                } catch (Exception ignored) { }

                result.setLogo(source.getLogo());
                result.setSortNum(source.getSortNum());
                result.setId(source.getId());
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}